import { FoodHold } from './FootHold.js';

export function FootHoldTree(FoodHoldInfo) {
    this.footholdTree = {};
    this.walls = [];
    Object.keys(FoodHoldInfo).forEach((key) => {
        Object.values(FoodHoldInfo[key]).forEach((its,key2)  => {
            Object.keys(its).forEach(it => {
                this.footholdTree[it] = new FoodHold(it, Number(key), its[it]);
                if (this.footholdTree[it].isWall()) {
                    this.walls.push(this.footholdTree[it]);
                }
            })
        })   
    })
} 

